﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp11
{
    class CaiPan : Father
    {
        public void kaishi1()
        {
            Console.WriteLine("开始游戏吗？<y/n>");
            string start = Console.ReadLine();
            while (true)
            {
                if (start == "y")
                {
                    Father quan = new Father("石头", "剪刀", "布");
                    quan.chuquan();
                    quan.change1();
                }
                else if (start == "n")
                {
                    quxiao();
                }
                else
                {
                    youwu();
                }
            }
        }

        public void kaishi2()
        {
            Console.WriteLine("开始游戏吗？<y/n>");
            string start = Console.ReadLine();
            while (true)
            {
                if (start == "y")
                {
                    Father quan = new Father("石头", "剪刀", "布");
                    quan.chuquan();
                    quan.change2();
                }
                else if (start == "n")
                {
                    quxiao();
                }
                else
                {
                    youwu();
                }
            }
        }

        public void kaishi3()
        {
            Console.WriteLine("开始游戏吗？<y/n>");
            string start = Console.ReadLine();
            while (true)
            {
                if (start == "y")
                {
                    Father quan = new Father("石头", "剪刀", "布");
                    quan.chuquan();
                    quan.change3();
                }
                else if (start == "n")
                {
                    quxiao();
                }
                else
                {
                    youwu();
                }
            }
        }
        public void quxiao()
        {
            Console.WriteLine("你取消了游戏！");
            Environment.Exit(0);
        }

        public void youwu()
        {
            Console.WriteLine("你的输入有误！");
            Environment.Exit(0);
        }

    }
}
